#编写时间:2022-10-24
#编写人:付学瑞
import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import*
testCase="DBshop018_商品管理商品属性属性分组"
groupname="好好学习"

# 1.点击“删除”按钮，确认删除，删除成功。
firefox=openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)
DBshopEnterMenu3(firefox,"商品管理","商品属性","属性分组")
firefox.find_element_by_xpath("//td[text()='%s']/following-sibling::td[2]/a[2]"%groupname).click()
firefox.switch_to_alert().accept()
time.sleep(2)
# 断言
try:
    firefox.find_element_by_xpath("//td[text()='%s']"%groupname).is_displayed()
    writeLog("%s 测试失败" % testCase)
    getPhoto(firefox)
except:
    writeLog("%s 测试通过" % testCase)
firefox.quit()